package resources;

import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class ResourceTest {
    public static void main(String[] args) throws IOException{
        Class<?> cl = ResourceTest.class;
        URL aboutUrl = cl.getResource("about.gif");
        var icon = new ImageIcon(aboutUrl);

        var stream = cl.getResourceAsStream("about.txt");
        var about = new String(stream.readAllBytes(), "UTF-8");

        var stream2 = cl.getResourceAsStream("title.txt");
        var title = new String(stream2.readAllBytes(), StandardCharsets.UTF_8).strip();

        JOptionPane.showMessageDialog(null, about, title, JOptionPane.INFORMATION_MESSAGE, icon);
    }
}
